const getList = (req, res, next) => {
    // 参数验证
    let { current, pagesize, search, filter, sale_type, sortType, sortMethod } = req.query
    
    current === undefined && (req.query.current = current = 1)
    pagesize === undefined && (req.query.pagesize = pagesize = 12)
    search === undefined && (req.query.search = '')
    filter === undefined && (req.query.filter = '')
    sale_type === undefined && (req.query.sale_type = sale_type = '')
    sortType === undefined && (req.query.sortType = sortType = '_id')
    sortMethod === undefined && (req.query.sortMethod = sortMethod = 'ASC')
    
    next()
  }

module.exports={
    getList
}